package com.test;

import com.admin.Action;
import com.admin.ActionFactory;
import com.admin.dto.BookListBean;
import com.admin.service.bookservice.BookServiceImpl;
import com.admin.service.bookservice.BookServiceInF;
import com.admin.service.borservice.BorServiceImpl;
import com.borrower.service.BorrowerService;
import com.borrower.service.BorrowerServiceImpl;
import com.google.gson.Gson;
import com.pojo.BorrowerBean;
import org.junit.Test;

import java.util.List;

public class test {
    public static void main(String[] args) {

        BorrowerBean bor = new BorrowerBean();
        bor.setBalance(9999.99);
        bor.setUserId(1);
        BorServiceImpl service = new BorServiceImpl();
        boolean bool = service.updateBorBalance(bor);
        System.out.println("充值" + bool);
    }
    @Test
    public  void sss(){
        BookServiceInF bookService = new BookServiceImpl();

        List<BookListBean> list= bookService.queryBookInfoByBookName("笑傲");
        System.out.println(list);
        System.out.println("0000000------------------000000000");
        String str=null;
//        for(BookListBean bu:list){
//            bu.getBookName();
//            bu.getAuthor();
//            bu.getTypeName();
//            bu.getPress();
//            bu.getStock();
//            bu.getBorrowPrice();
//            str=
//
//        }
        Gson gson = new Gson();
        String jsonStr =   gson.toJson(list);
        System.out.println(jsonStr);

//        System.out.println(listBeans);
    }
    @Test
    public void hsudhsu(){
        BorrowerService service = new BorrowerServiceImpl();
        List<BorrowerBean> list=service.UserInfoService("静静");
        Long userId= null;
        for(BorrowerBean be:list){
            userId=be.getUserId();
            System.out.println(be.getUserId());
        }
        System.out.println(userId);

    }


}
